<?php
/**
 * Value Object From Order Line
 * @author pablo
 *
 */
class Cart_VO_Line
{
	/**
	 * @var int LineId
	 */
	public $sales_line_id;
	/**
	 * @var int ProductId
	 */
	public $product_id;
	/**
	 * @var string ProductType
	 */
	public $product_type;
	/**
	 * @var string ProductDescription
	 */
	public $product_description;
	/**
	 * @var string ProductDetail
	 */	
	public $product_detail;
	/**
	 * @var int Quantity
	 */
	public $ordered_quantity;
	/**
	 * @var float UnitSellingPrice
	 */
	public $unit_selling_price;
	/**
	 * @var float unitShippingPrice
	 */
	public $unit_shipping_price;
	/**
	 * @var float unitFinalPrice
	 */
	public $unit_final_price = 0;
	/**
	 * @var float TAX
	 */
	public $pcnt_tax;
	/**
	 * @var int orderLineId
	 */
	public $line_order;
	/**
	 * Value Object for the item order
	 * @param array $line
	 * @return Cart_VO_ItemVO
	 */
	public function __construct( $line )
	{
		$this->sales_line_id = $line->sales_line_id;
		$this->product_id = $line->product_id;
		$this->product_type = $line->product_type;
		$this->product_description = $line->product_description;
		$this->product_detail = $line->product_detail;
		$this->ordered_quantity = $line->ordered_quantity;
		$this->unit_selling_price = $line->unit_selling_price;
		$this->unit_shipping_price = $line->unit_shipping_price;
		$this->unit_shipping_price = $line->unit_shipping_price;
		$this->pcnt_tax = $line->pcnt_tax;
		$this->unit_final_price = 0;
		$this->line_order = $line->line_order;
	}
	
	public function toArray()
	{
		return array(
			'sales_line_id' => $this->sales_line_id,
			'product_id' => $this->product_id,
			'product_type' => $this->product_type,
			'product_description' => $this->product_description,
			'product_detail' => $this->product_detail,
			'ordered_quantity' => $this->ordered_quantity,
			'unit_selling_price' => $this->unit_selling_price,
			'unit_shipping_price' => $this->unit_shipping_price,
			'pcnt_tax' => $this->pcnt_tax,
			'unit_final_price' => $this->unit_final_price,
			'line_order' => $this->line_order 
		);
	}
}